#pragma once
#include <fmod.h>
#include <fmod.hpp>
#include <fmod_errors.h>
#include <iostream>
#include <vector>

#include "AudioUtils.h"

using namespace std;

namespace PlugManager{
	struct Dsp{
		FMOD::DSP *dsp;
		int ID;
	};
	typedef std::vector<Dsp> dsp_list;
	typedef std::vector<FMOD::DSP *> built_in_dsp_list;
	class PluginManager
	{
		public:
			PluginManager(FMOD::System *,FMOD::ChannelGroup *OutputChannel);
			PluginManager(const PluginManager &);
			PluginManager & operator=(const PluginManager &);
			~PluginManager(void);
			void addDSP(FMOD::DSP *);
			void rmDSP(int dspID);
			void moveDSP(int dspID, int dspPos);
			Dsp getDSP(int dspID);
			FMOD::DSP *getBuiltInDsp(FMOD_DSP_TYPE type);
			dsp_list * getDSPs();

			void byPassBuiltInFx(bool);
			static int dspCounter;

		private:
			dsp_list * fxs;
			built_in_dsp_list built_in_fx;
			FMOD::ChannelGroup *OutputChannel;
	};
}

